package lxh.grails.basic;

println Math.round(Math.ceil(10.2));

def str = "我们"

def str2 = URLEncoder.encode(str);
def str3 = URLDecoder.decode(str2);

println "str2:${str2} | str3:${str3}"

println "${new Date()}" 

Integer ig = new Integer(10);
def newVal = ig + 10;
println newVal;

def forbidTrans = "123";
def forbidTransNum = forbidTrans.toDouble();
println forbidTransNum+1;

println new Date().plus(1);

println System.currentTimeMillis();

def str100 = "1234567";
println str100.substring(str100.length()-7);

println "1111111111111111111";
s1 = "Hello \"World\" ";
s2 = 'Hello "World" ';
assert s1 == s2
println "22222222222222222222";

println 10.0*20000

println "123456".getBytes().encodeBase64();

def str9 = "abc@aaa.com";
str9 = str9.substring(0, str9.indexOf('@'));
println str9;

//四舍五入
def num100 = 0.251;
def numRes = num100.setScale(2, BigDecimal.ROUND_HALF_UP);
println numRes;

//temp
int totalNum = 12080+9880+13380+20880+9880+10380+19880+9880+10880+19880+13752+32980;
println totalNum;
double totalFront = 2196.26*4+2474.01+2751.76+2801.51*6;
println totalFront;
double totalFax = 1201.75+761.75+1461.75+2961.75+706.20+750.65+2640.70+640.70+360.70+2389.62+935.10+2457.85;
println totalFax;

